home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 October
/
EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso
/
Aminet
/
util
/
time
/
dutchtim.lha
/
DutchTime.MOD
< prev
next >
Wrap
Text File
|
1995-05-18
|
3KB
|
149 lines
MODULE Dutchtime;
IMPORT I:=InOut;
FROM Intuition IMPORT CurrentTime;
TYPE Str = ARRAY [0..79] OF CHAR;
n2tp = RECORD
units : ARRAY [1..19] OF Str;
tens : ARRAY [2..9] OF Str;
END;
VAR n2 :n2tp;
PROCEDURE init();
BEGIN
n2.units[01]:=('een');
n2.units[02]:=('twee');
n2.units[03]:=('drie');
n2.units[04]:=('vier');
n2.units[05]:=('vijf');
n2.units[06]:=('zes');
n2.units[07]:=('zeven');
n2.units[08]:=('acht');
n2.units[09]:=('negen');
n2.units[10]:=('tien');
n2.units[11]:=('elf');
n2.units[12]:=('twaalf');
n2.units[13]:=('dertien');
n2.units[14]:=('veertien');
n2.units[15]:=('vijftien');
n2.units[16]:=('zestien');
n2.units[17]:=('zeventien');
n2.units[18]:=('achttien');
n2.units[19]:=('negentien');
n2.tens[2]:=('twintig');
n2.tens[3]:=('dertig');
n2.tens[4]:=('veertig');
n2.tens[5]:=('vijftig');
END init;
PROCEDURE COMBINE2 (N:LONGINT);
VAR H:LONGINT;
BEGIN
IF (N<20) THEN
I.WriteString(n2.units[N]);
ELSE
H:=N DIV 10;
I.WriteString(n2.units[N-H*10]);
I.WriteString('en');
I.WriteString(n2.tens[H]);
END;
END COMBINE2;
PROCEDURE Tijd12 (X,Y:LONGINT);
BEGIN
X:=X MOD 12 ;
I.WriteString ('Het is ');
IF Y=0
THEN
COMBINE2 (X);
I.WriteString (' uur');
ELSIF Y=1
THEN
I.WriteString ('één minuut over ');
COMBINE2 (X);
ELSIF (Y>1) & (Y<15)
THEN
COMBINE2 (Y);
I.WriteString (' minuten over ');
COMBINE2 (X);
ELSIF Y=15
THEN
I.WriteString ('kwart over ');
COMBINE2 (X);
ELSIF (Y>15) & (Y<29)
THEN
COMBINE2 (30-Y);
I.WriteString (' minuten voor half');
COMBINE2 (X+1);
ELSIF Y=29
THEN
I.WriteString ('één minuut voor half ');
COMBINE2 (X+1);
ELSIF Y=30
THEN
I.WriteString ('half ');
COMBINE2 (X+1);
ELSIF Y=31
THEN
I.WriteString ('één minuut over half');
COMBINE2 (X+1);
ELSIF (Y>31) & (Y<45)
THEN
COMBINE2 (Y-30);
I.WriteString (' minuten over half');
COMBINE2 (X+1);
ELSIF Y=45
THEN
I.WriteString ('kwart voor ');
COMBINE2 (X+1);
ELSIF Y=59
THEN
I.WriteString ('één minuut voor ');
COMBINE2 (X+1);
ELSE
COMBINE2 (60-Y);
I.WriteString (' minuten voor ');
COMBINE2 (X+1);
END;
I.WriteString ('.');
I.WriteLn;
END Tijd12;
VAR seconds,seconds2,micros,uren,minuten :LONGINT;
BEGIN
init();
CurrentTime(seconds , micros);
minuten:=(seconds DIV 60);
(* Het aantal verstreken uren en minuten in minuten *)
uren:=(minuten DIV 60);
(*Het aantal verstreken uren in uren*)
(*seconds:=seconds-minuten*60;
het aantal verstreken seconden*)
minuten:=minuten-uren*60;
(*het aantal verstreken minuten*)
Tijd12(uren,minuten);
I.WriteLn;
END Dutchtime.